#ifndef NWID_H
#define NWID_H

#include <QWidget>
#include <QtDesigner/QDesignerExportWidget>
#include <TrafficWid.h>
#include <vector>
#include "trafficlight.h"

using namespace std;
namespace Ui {
class nWid;
}

class QDESIGNER_WIDGET_EXPORT nWid : public QWidget
{
    Q_OBJECT

public:
    explicit nWid(QWidget *parent = 0);
    ~nWid();
    //在布局中插入TrafficWid
    void new_nwid(vector<TrafficWid *> twidvec);

    void set_traffic(const TrafficLight &traf)
    {
        Traf = traf;
    }

    TrafficLight get_traffic()
    {
        return Traf;
    }

protected:
    //重写mousePressEvent事件
    virtual void mousePressEvent(QMouseEvent* event);
signals:
    void clicked(TrafficLight);
private:
    Ui::nWid *ui;
    TrafficLight Traf;
};

#endif // NWID_H
